Image primer

We are surrounded by images, all day, every day. We copy, paste, swipe, snap, share, ... But working with mission images, we have to reset our minds to a different approach. This deep dive is all about working with image data products from the PDS archive.

Who doesn't like looking at pictures from other worlds? How amazing! That amazing picture you see on a web page has a complex ancestor: a science data file with a format that most computer programs don't understand. Instead, you have to use specialized software to work with archive images because the information in images often cannot be stored in everyday formats like JPEG.

Sometimes you will find a browse version of an image that can be opened in a web browser or pasted into your presentation. This is a simplified version of an image that is useful for quickly assessing an image, but it is not suitable for containing the detailed science measurements. Browse versions, also called quicklooks, generally are not suitable for science-based research.

Image structure

All images share common attributes regarding their size: samples, lines, and bands.

Some images have more complex structures, but this is a good place to start.

Going extra deep on data types

Data interleave

A computer program reads the pixel values from an image file as a sequence of numbers.

It needs to know the image structure, specifically the number of samples, lines, and bands, and in what order to expect the pixels—the data interleave. Three common data interleaves found in image processing software are band sequential (BSQ), band interleaved by pixel (BIP), and band interleaved by line (BIL).

In band sequential order, all of the pixels for each band are in a contiguous block: [sample 1, line 1, band 1] [sample 2, line 1, band 1] [sample 3, line 1, band 1] and so on to the end of the first line, then on to the second line, third line, etc. Once we are at the end of the first band, the next pixel will be [sample 1, line 1, band 2]. If you consider the image as a three dimensional cube with samples, lines, and bands as the three axes, the sample axis is changing the fastest. You can imagine other arrangements of pixels in an image. So can the data providers.

Pixels data types

Each image pixel in a data file has a numeric value, and for any image the pixel values will fall within a certain range, for example integers from 0 to 255. Some images have pixel with real (floating point) number values or that span a larger range of values. Assigning a data type to an image constrains the pixel values allowed. A "byte image" is a common term used to denote that an image has pixels values that fit within a single byte of computer storage, that is, integer values from 0 to 255. Data types are more complicated when the numeric values are outside this range or when floating point values are required. Each pixel value might require 2 or 4 or even 8 bytes, and the order of the bytes is important, at least to the computer. This is why you need specialized software to work with some archive images: web browsers and general software are not good at working with images that have complex data types. It is possible to convert an image from a complex data type to a simple one that web browsers can understand (the browse version mentioned above), but you lose the science data fidelity.

Finding the structure of an image

Scientific software that reads PDS formatted images is available, such as the GDAL translator library and ENVI image processing. Still, you may need to know an image's structure.

The data product label is key to finding the structure of an image. Each data product in the archive has a label with metadata that describe the file content and format. A PDS4 format image product has a label file separate from the image data file. Earlier PDS format images sometimes had labels found at the beginning of the image file.

Let's take a look at the example below. It is part of the label from an InSight Instrument Context Camera image.

The label metadata contains some important information about the image (see the red boxes pointers):

The label gives some additional info (purple and green box pointers):

All archive images have metadata that describe the image structure.

Working with images inside the Notebook

The Notebook presents image data in several ways.

Working with images outside of the Notebook

Whether you work with the data as archived or with a browse version depends on what you are trying to do. Recall that a browse image is sufficient for tasks like learning the context of an observation, but in other cases, like radiometric studies, you must work with the original data. Some image data files do not make much sense as browse images, for example, reachability maps and XYZ location images.

Browse versions of images as JPEGs or PNGs are available from the Notebook in two ways. When viewing an image product in the detail window, select Action > Download from the menu. In addition to the archived image and its label, browse versions will be listed and may be downloaded individually. To get browse versions of multiple images, add the images to the cart. Then, at checkout, edit your settings to include a browse image with your order. These browse images can be viewed by any software that reads JPEG or PNG images.

More specialized software is required for images in PDS format. These packages need to have a built-in reader that understands PDS format, or allow you the opportunity to input image parameters from the label. Available packages include:

 

see also